import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/home"
  },
  {
    path: '/',
    component:()=> import('../views/Layout.vue'),
    children:[
      {
        path: 'home',
        name: 'Home',
        component:()=> import('../views/Home/myHome.vue'),
        children:[
          {
            path:'myhead',
            name : 'myHead',
            component:() => import('../pages/myhead/onionHead.vue'),
          },
           {
            path:'mybanner',
            name : 'myBanner',
            component:() => import('../pages/mybanner/onionBanner.vue'),
          },
          {
            path:'mynav',
            name : 'myNav',
            component:() => import('../pages/mynav/onionNav.vue'),
          }
        ]
      },
      {
        path :'classify',
        name : 'Classify',
        component:()=> import('../views/Classify/myClassify.vue'),
      },
      {
        path :'cart',
        name : 'Cart',
        component:()=> import('../views/Cart/myCart.vue'),
      },
      {
        path :'person',
        name : 'Person',
        component:()=> import('../views/Person/myPerson.vue'),
      }
    ]
  },
  {
    path:'/search',
    name : 'Search',
    component:()=> import('../views/search/searchGood.vue')
  },
  {
    path:'/product',
    name : 'Product',
    component:()=> import('../views/Product/productList.vue')
  },
  {
    path:'/commodity',
    name : 'Commodity',
    component:()=> import('../commodity/information.vue')
  },
  {
    path:'/collect',
    name : 'Collect',
    component:()=> import('../model/collect/mycollect.vue')
  },
  {
    path:'/login',
    name : 'Login',
    component:()=> import('../login/mylogin.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
